<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!--[if !IE]> -->
<link rel="stylesheet" href="${_staticPath}/assets/css/pace.css" />
<script data-pace-options='{ "ajax": true, "document": true, "eventLag": false, "elements": false }' src="${_staticPath}/assets/js/pace.js"></script>
<!-- <![endif]-->

<!-- bootstrap & fontawesome -->
<link rel="stylesheet" href="${_staticPath}/assets/css/bootstrap.css" />
<link rel="stylesheet" href="${_staticPath}/assets/css/font-awesome.css" />
<!-- text fonts -->
<link rel="stylesheet" href="${_staticPath}/assets/css/ace-fonts.css" />

<!-- ace styles -->
<link rel="stylesheet" href="${_staticPath}/assets/css/ace.css" class="ace-main-stylesheet" id="main-ace-style" />

<!-- 自定义样式，表单多选框 -->
<%-- <link rel="stylesheet" href="${_staticPath}/script/assets/ace.custom.css" /> --%>

<!--[if lte IE 9]>
	<link rel="stylesheet" href="${_staticPath}/assets/css/ace-part2.css" class="ace-main-stylesheet" />
<![endif]-->

<!--[if lte IE 9]>
  <link rel="stylesheet" href="${_staticPath}/assets/css/ace-ie.css" />
<![endif]-->

<!-- ace settings handler -->
<script src="${_staticPath}/assets/js/ace-extra.js"></script>

<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->

<!-- [if lte IE 8]>
<script src="${_staticPath}/assets/js/html5shiv.js"></script>
<script src="${_staticPath}/assets/js/respond.js"></script> 
<![endif]-->
<!-- 日期选择框 -->
<link rel="stylesheet" href="${_staticPath}/assets/css/datepicker.css" />
<link rel="stylesheet" href="${_staticPath}/assets/css/bootstrap-timepicker.css" />

<!--编辑器-->
<script charset="UTF-8" type="text/javascript"src="${path}/script/kindeditor/kindeditor.js"></script> 
<script charset="UTF-8"  type="text/javascript" src="${path}/script/kindeditor/lang/zh_CN.js"></script>
<script charset="UTF-8" type="text/javascript"src="${path}/script/kindeditor/plugins/code/prettify.js"></script>
<link rel="stylesheet" href="${path}/script/kindeditor/plugins/code/prettify.css" type="text/css"></link>
<link rel="stylesheet" href="${path}/script/kindeditor/themes/default/default.css" type="text/css"></link>
<style>
	.clearfix.help-validate img{
	    max-width: 200px;
	    max-height: 70px;
	}
</style>
<script type="text/javascript">
	var uploadItem={
		url: "",// 数据获取url
		uploadButton: null// 数据获取url
	};
	
	KindEditor.ready(function(K) {
		var uploadEditor = K.editor({
			allowFileManager : true
		});
// 		K('.form-button-common.upload').click(function() {
// 			var $this=$(this);
// 			var $image=$this.prev().prev();
// 			var $url=$this.prev();
// 			uploadEditor.loadPlugin('image', function() {
// 				uploadEditor.plugin.imageDialog({
// 					imageUrl : $url.val(),
// 					clickFn : function(url, title, width, height, border, align) {
// 						$url.val(url);
// 						$image.css("display","");
// 						$image.attr("src",url);
// 						uploadEditor.hideDialog();
						
// 						$.extend(uploadItem, {"url":url,"uploadButton":$this});
// 						afterUploadEditorClose(uploadItem);
// 					}
// 				});
// 			});
// 		});


		$('body').on('click','.form-button-common.upload',function(){
			var $this=$(this);
			var $image=$this.prev().prev();
			var $url=$this.prev();
			uploadEditor.loadPlugin('image', function() {
				uploadEditor.plugin.imageDialog({
					imageUrl : $url.val(),
					clickFn : function(url, title, width, height, border, align) {
						$url.val(url);
						$image.css("display","");
						$image.attr("src",url);
						uploadEditor.hideDialog();
						
						$.extend(uploadItem, {"url":url,"uploadButton":$this});
						afterUploadEditorClose(uploadItem);
					}
				});
			});
		})
	});
	
	function afterUploadEditorClose(uploadItem){
		
	}
</script>

